$(function(){
    initFwztpfData();//加载界面中需要的数据
});

/*********************************************服务整体情况tab页数据加载***************************************************/

//服务整体评分折线图
function initFwztpfData(){
    var echart = echarts.init(document.getElementById("jylfx"));
    diff = [1.87,1.87,1.87,1.87,1.87,1.87,1.87,1.87,1.87,1.87,
        1.87,2.13,1.87,1.87,1.87,2.87,1.87,1.47,1.37,1.27,
        1.17,0.87,0.7,0.37,0.37,0.2,0.1]
    dates = ['00:00','01:00','02:00','03:00',
        '04:00','05:00','06:00','07:00','08:00',
        '09:00','10:00','11:00','12:00','13:00',
        '13:00','14:00','15:00','16:00','17:00',
        '18:00','19:00','20:00','21:00','22:00',
        '23:00']
    prices = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.87,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0]

    option = {
        title: {
            text: '交易量'
        },
        tooltip: {
            trigger: 'axis',
            formatter: '{b0}<br>'+
            '平均交易量：{c0}<br> '+
            '交易量：{c1}<br> '
        },
        legend: {
            data:['平均交易量','交易量'],
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: dates
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name:'平均交易量',
                type:'line',
                data:diff
            },
            {
                name:'交易量',
                type:'line',
                data:prices
            }
        ]
    };
    echart.setOption(option);
    echart.hideLoading();
    //自动适应屏幕浏览器的大小 当浏览器大小改变时 报表画布也跟着改变
    window.onresize = function () {
        echart.resize();
    };
}

/**********************************************************************************************************************/

function checkIsNull(val){
    if("undefined"!==val&&undefined!==val&&""!==val&&"null"!==val&&null!==val){
        return false;
    }else{
        return true;
    }
}

function backShuZiL(str){
    if(checkIsNull(str)){
        return 0;
    }else{
        return str;
    }
}

